﻿@model INTREPWEB.Models.ItemViewModel
@{
    if (IsAjax)
    {
        Layout = null;
    }
    else
    {
        <input type="submit" value="Salvar" />
    }
}

@Html.ValidationSummary(true)
<fieldset>
    <legend>Ítem de Embarque</legend>

    @Html.HiddenFor(model => model.EmbarqueId)
    <div class="editor-label">
        @Html.LabelFor(model => model.RE)
    </div>
    <div class="editor-field">
        @Html.EditorFor(model => model.RE)
        <br />
        @Html.ValidationMessageFor(model => model.RE)
    </div>
        <div class="editor-label">
        @Html.LabelFor(model => model.ExportadorId)
    </div>
    <div class="editor-field">
        @Html.DropDownListFor(x => x.ExportadorId, Model.Exportadores as SelectList)
        @Ajax.ActionLink("+ (ajax)", "Criar", "Exportador", new AjaxOptions { UpdateTargetId = "modal2", OnSuccess = "$.modalPopup('modal2')" })
        <br />
        @Html.ValidationMessageFor(model => model.ExportadorId)
    </div>
    <div class="editor-label">
        @Html.LabelFor(model => model.PesoManifestado)
    </div>
    <div class="editor-field">
        @Html.EditorFor(model => model.PesoManifestado)
        <br />
        @Html.ValidationMessageFor(model => model.PesoManifestado)
    </div>

    <div class="editor-label">
        @Html.LabelFor(model => model.PesoEmbarcado)
    </div>
    <div class="editor-field">
        @Html.EditorFor(model => model.PesoEmbarcado)
        <br />
        @Html.ValidationMessageFor(model => model.PesoEmbarcado)
    </div>

    <div class="editor-label">
        @Html.LabelFor(model => model.Unidade)
    </div>
    <div class="editor-field">
        @Html.EditorFor(model => model.Unidade)
        <br />
        @Html.ValidationMessageFor(model => model.Unidade)
    </div>        
</fieldset>